import request from '@/utils/request'

// 登录方法
export const login = (data) => {
	return request({
		url: '/app/login',
		headers: {
			isToken: false,
		},
		header: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		'method': 'post',
		data
	})
}

// 注册方法
export const register = (data) => {
	return request({
		url: '/app/register',
		headers: {
			isToken: false,
		},
		header: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		method: 'post',
		data
	})
}

// 忘记密码获取验证码
export const forgotPasswordGetCode = (data) => {
	return request({
		url: '/app/register/getSmsCodeForget',
		headers: {
			isToken: false,
		},
		'method': 'get',
		data
	})
}

// 修改密码
export const updatePassword = (data) => {
	return request({
		url: '/app/register/updatePassword',
		headers: {
			isToken: false,
		},
		header: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
		'method': 'post',
		data
	})
}

// 注册获取验证码
export const getCodeStr = (data) => {
	return request({
		'url': `/app/truckDriver/strPhone`,
		headers: {
			isToken: false
		},
		header: {
			"content-type": "application/x-www-form-urlencoded"
		},
		method: 'post',
		data
	})
}

// 注册校验验证码
export const verificationCodeStr = (data) => {
	return request({
		'url': `/user/strCode`,
		headers: {
			isToken: false
		},
		method: 'post',
		timeout: 20000,
		data
	})
}

// 验证码登录
export const codeLogin = (data) => {
	return request({
		'url': `/app/verifyCodeLogin`,
		headers: {
			isToken: false
		},
		header: {
			"content-type": "application/x-www-form-urlencoded"
		},
		method: 'post',
		timeout: 20000,
		data
	})
}

// 验证码登录获取验证码
export const getLoginCode = (data) => {
	return request({
		'url': `/app/truckDriver/sendLoginCode`,
		headers: {
			isToken: false
		},
		header: {
			"content-type": "application/x-www-form-urlencoded"
		},
		method: 'post',
		data
	})
}